﻿using CCF20Model;
using System.Collections;
using WiseLink.RDS.Resource;

namespace CCF20Module.DeviceState
{
    public class DefectedState : DeviceStateBase
    {

        public DefectedState(IDeviceHandler handler, DeviceModel model, VehicleModel vModel,Device device, IList list)
            : base(handler, model, vModel, device, list)
        {
            this.failReason = Message.Device_InRepair;
            StateName = DeviceStatus.Repair;
            //LoggerHelper.LogCCF20("进入损坏状态初始化");
        }

        #region ExecuteAction

        public override string runInStock()
        {
            return base.runInStock();
        }

        public override string runSellToCustomer(int customerId)
        {
            return base.runSellToCustomer(customerId);
        }

        public override string runRegisterIDC()
        {
            return base.runRegisterIDC();
        }
        public override string runUnRegisterIDC()
        {
            return base.runUnRegisterIDC();
        }
        public override string runRegisterSpeicalIDC()
        {
            return base.runRegisterSpeicalIDC();
        }
        public override string runUnRegisterSpeicalIDC()
        {
            return base.runUnRegisterSpeicalIDC();
        }

        public override string runExchangeDevice(string idc, string deviceKey)
        {
            return Message.Device_CantExchagne_Repair;
        }

        public override string runReturnDevice()
        {
            return base.runReturnDevice();
        }
        public override string runRepairStart()
        {
            return string.Format(Message.Device_RepairStart, currentDevice.IDCSimNumber);
        }
        public override string runRepairEnd()
        {
            currentDevice.DeviceStatus = currentDevice.PreviousDeviceStatus;
            currentDevice.IsDefected = false;
            deviceHandler.InitializeState();
            deviceModel.Update();
            return string.Format(Message.Device_RepariEnd, currentDevice.IDCSimNumber,currentDevice.DeviceStatus);
        }

        public override string runDeleteDevice()
        {
            return base.DeleteDevice();
        }

        #endregion
    }
}
